home *** CD-ROM | disk | FTP | other *** search
/ Aminet 30 / Aminet 30 (1999)(Schatztruhe)[!][Apr 1999].iso / Aminet / misc / math / MathFX_src.lha / fxabv.c < prev    next >
C/C++ Source or Header  |  1995-12-20  |  496b  |  24 lines

  1. #include "mathfx.h"
  2.  
  3.  
  4.  
  5. /* Determines if point (px,py) lies above the line joining (sx1,sy1) to */
  6. /* (sx2,sy2). It only works correctly if sx1 <= px <= sx2  */
  7.  
  8. int fxabv(px, py, sx1, sy1, sx2, sy2)
  9. int px, py, sx1, sy1, sx2, sy2;
  10. {
  11.       int above;
  12.  
  13.       if (py >= sy1 && py >= sy2) 
  14.         above = 1;
  15.       else if (py < sy1 && py < sy2)
  16.         above = 0;
  17.       else if ((sx2-sx1) * (py-sy1) > (px-sx1) * (sy2-sy1)) 
  18.         above = 1;
  19.       else
  20.         above = 0;
  21.  
  22.       return(above);
  23. }
  24.